using System;
using System.Collections.Generic;

namespace Book.Blog.Core.DTOs
{
    public class PostDTO
    {
        public Guid Id { get; set; }
        public required string Title { get; set; }
        public required string Content { get; set; }
        public required string Summary { get; set; }
        public required string Slug { get; set; }
        public bool IsDraft { get; set; }
        public bool IsPublished { get; set; }
        public DateTime? PublishTime { get; set; }
        public int ViewCount { get; set; }
        public int LikeCount { get; set; }
        public int CommentCount { get; set; }
        public DateTime CreatedTime { get; set; }
        public DateTime? UpdatedTime { get; set; }
        
        public Guid UserId { get; set; }
        public required string UserName { get; set; }
        public string? UserAvatar { get; set; }
        
        public Guid? CategoryId { get; set; }
        public string? CategoryName { get; set; }
        
        public required List<TagDTO> Tags { get; set; }
    }

    public class CreatePostDTO
    {
        public required string Title { get; set; }
        public required string Content { get; set; }
        public required string Summary { get; set; }
        public required string Slug { get; set; }
        public bool IsDraft { get; set; }
        public bool IsPublished { get; set; }
        public Guid? CategoryId { get; set; }
        public List<Guid>? TagIds { get; set; }
    }

    public class UpdatePostDTO
    {
        public required string Title { get; set; }
        public required string Content { get; set; }
        public required string Summary { get; set; }
        public required string Slug { get; set; }
        public bool IsDraft { get; set; }
        public bool IsPublished { get; set; }
        public Guid? CategoryId { get; set; }
        public List<Guid>? TagIds { get; set; }
    }

    public class PostListDTO
    {
        public Guid Id { get; set; }
        public required string Title { get; set; }
        public required string Summary { get; set; }
        public required string Slug { get; set; }
        public bool IsPublished { get; set; }
        public DateTime? PublishTime { get; set; }
        public int ViewCount { get; set; }
        public int LikeCount { get; set; }
        public int CommentCount { get; set; }
        public DateTime CreatedTime { get; set; }
        
        public Guid UserId { get; set; }
        public required string UserName { get; set; }
        public string? UserAvatar { get; set; }
        
        public string? CategoryName { get; set; }
        public required List<string> TagNames { get; set; }
    }

    public class PostPagedListDTO
    {
        public required List<PostListDTO> Items { get; set; }
        public int TotalCount { get; set; }
        public int PageIndex { get; set; }
        public int PageSize { get; set; }
        public int TotalPages { get; set; }
        public bool HasPreviousPage { get; set; }
        public bool HasNextPage { get; set; }
    }

    public class TagDTO
    {
        public Guid Id { get; set; }
        public required string Name { get; set; }
        public string? Description { get; set; }
        public required string Slug { get; set; }
        public int PostCount { get; set; }
    }
} 